#ifndef _AGGREGATE_H_
#define _AGGREGATE_H_

#include "messages.h"
#include "generics.h"

struct aggregate_context {
    unsigned long long init_cycle;
};

int  aggregate_init(void);
void aggregate_release(void);

void aggregate_pre(int op, struct aggregate_context* agg_context);
void aggregate_post(int op, struct aggregate_context* agg_context);

#define AGGREGATE_PRE(op) \
	struct aggregate_context agg_context; \
	aggregate_pre((op), &agg_context);

#define AGGREGATE_POST(op) \
	aggregate_post((op), &agg_context);

#endif

